import request from '@/router/axios';
import config from '@/config/website'

//列表
export const potentialProjectsList = (current, size, equipment) => {
    return request({
        url: '/api/hg-public/hg_project/potentialProject/page',
        method: 'get',
        params: {
            current,
            size,
            ...equipment
        }
    })
}


//新建
export const potentialProjectsAdd = (data) => {
    return request({
        url: '/api/hg-public/hg_project/potentialProject/save',
        method: 'post',
        data
    })
}
//修改
export const potentialProjectsUpdate = (data) => {
    return request({
        url: '/api/hg-public/hg_project/potentialProject/update',
        method: 'post',
        data
    })
}
//查看
export const potentialProjectsView = (id) => {
    return request({
        url: '/api/hg-public/hg_project/potentialProject/detail',
        method: 'get',
        params: {
            id
        }
    })
}

//删除
export const potentialProjectsDel = (ids) => {
    return request({
        url: '/api/hg-public/hg_project/potentialProject/remove',
        method: 'post',
        params: {
            ids
        }
    })
}

//产品要求
export const requirementList = (id, proType) => {
    return request({
        url: '/api/hg-public/hg_project/potentialRequire/list',
        method: 'get',
        params:{
            id,
            proType
        }
    })
}
export const requirementSave = (data) => {
    return request({
        url: '/api/hg-public/hg_project/potentialRequire/save',
        method: 'post',
        data
    })
}
//竞争对手
export const opponentList = (id, proType) => {
    return request({
        url: '/api/hg-public/hg_project/prjContendAnalyse/page',
        method: 'get',
        params: {
            id,
            proType
        }
    })
}
//原保存接口
// export const opponentSave = (data) => {
//     return request({
//         url: '/api/hg-public/hg_project/prjContendAnalyse/save',
//         method: 'post',
//         data
//     })
// }
export const opponentSave = (data) => {
    return request({
        url: '/api/hg-public/hg_project/prjContendAnalyse/submit',
        method: 'post',
        data
    })
}
export const opponentUpdate = (data) => {
    return request({
        url: '/api/hg-public/hg_project/prjContendAnalyse/update',
        method: 'post',
        data
    })
}
// export const opponentDel = (ids) => {
//     return request({
//         url: '/api/hg-public/hg_project/prjContendAnalyse/remove',
//         method: 'post',
//         params: {
//             ids
//         }
//     })
// }
export const opponentDel = (ids) => {
    return request({
        url: '/api/hg-public/hg_project/prjContendAnalyse/delete',
        method: 'post',
        params: {
            ids
        }
    })
}
export const opponentView = (id) => {
    return request({
        url: '/api/hg-public/hg_project/prjContendAnalyse/detail',
        method: 'get',
        params: {
            id
        }
    })
}
//产品信息
export const informationList = (current, size, potentialProjectId) => {
    return request({
        url: '/api/hg-public/hg_project/prjCustPrdDemand/page',
        method: 'get',
        params: {
            current,
            size,
            potentialProjectId
        }
    })
}
//产品信息
export const informationListDisPage = (potentialProjectId) => {
    return request({
        url: '/api/hg-public/hg_project/prjCustPrdDemand/getProducts',
        method: 'get',
        params: {
            potentialProjectId
        }
    })
}
export const informationSave = (data) => {
    return request({
        url: '/api/hg-public/hg_project/prjCustPrdDemand/save',
        method: 'post',
        data
    })
}
export const informationUpdate = (data) => {
    return request({
        url: '/api/hg-public/hg_project/prjCustPrdDemand/update',
        method: 'post',
        data
    })
}
export const informationDel = (ids) => {
    return request({
        url: '/api/hg-public/hg_project/prjCustPrdDemand/remove',
        method: 'post',
        params: {
            ids
        }
    })
}
export const informationView = (id) => {
    return request({
        url: '/api/hg-public/hg_project/prjCustPrdDemand/detail',
        method: 'get',
        params: {
            id
        }
    })
}
export const enclosureSave = (data) => {
    return request({
        url: '/api/hg-public/attach/save',
        method: 'post',
        data
    })
}
export const enclosureDel = (ids) => {
    return request({
        url: '/api/hg-public/attach/remove',
        method: 'post',
        params: {
            ids
        }
    })
}
export const enclosureList = (attachId) => {
    return request({
        url: '/api/hg-public/attach/list',
        method: 'get',
        params: {
            attachId
        }
    })
}
//客户联系人
export const customerLinkmanList = (customerId) => {
    return request({
        url: '/api/hg-public/customerlinkman/selectCustomerLinkman',
        method: 'get',
        params: {
            customerId
        }
    })
}
export const customerLinkmanList2 = (id) => {
    return request({
        url: '/api/hg-public/potentialsalelinkman/list',
        method: 'get',
        params: {
            id
        }
    })
}

export const remove = (ids) => {
    return request({
      url: '/api/hg-public/potentialsalelinkman/remove',
      method: 'post',
      params: {
        ids
      }
    })
  }
//项目可行性评估列表
export const assessmentList = (current, size, equipment) => {
    return request({
        url: '/api/hg-public/hg_project/potentialProject/assessPage',
        method: 'get',
        params: {
            current,
            size,
            ...equipment
        }
    })
}
//提交
export const potentialProjectsSubmit = (id) => {
    return request({
        url: '/api/hg-public/hg_project/potentialProject/start-process',
        method: 'post',
        params: {
            id,
        }
    })
}

export const commonEnclosureList = (proId) => {
    return request({
        url: '/api/hg-public/commonfile/list',
        method: 'get',
        params: {
            proId
        }
    })
}

export const getContendNameList = (proId) => {
    return request({
        url: '/api/hg-public/hg_project/contendanalysepotential/list',
        method: 'get',
        params: {
            proId
        }
    })
}
